package com.hdoit.ares.logical.cust.service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

import me.chanjar.weixin.mp.bean.result.WxMpUser;

import com.hdoit.ares.logical.cust.model.Customer;
import com.hdoit.ares.logical.viewmodel.cust.CustomerColumn;
import com.hdoit.ares.logical.viewmodel.cust.CustomerSearch;
import com.hdoit.ares.logical.viewmodel.cust.CustomerStatistic;
import com.hdoit.ares.logical.viewmodel.cust.CustomerTree;
import com.hdoit.ares.logical.viewmodel.cust.TeamShareCustomer;
import com.tennetcn.common.dao.base.ISuperService;
import com.tennetcn.common.message.PagerModel;
/**
 * @author      chenghuan
 * @email       
 * @createtime  2017年10月26日 16:26:21
 * @comment
 */
public interface ICustomerService extends ISuperService<Customer>{
	public Customer queryModelByUserIdentity(int userIdentity);
	
	public String queryIdByUserIdentity(int userIdentity);
	
	public int queryMaxUserIdentity();
	
	public Customer queryModelByOpenId(String openId);
	
	public Customer addCustomer(String openId, WxMpUser mpUser, int refereeIdentity);
	
	public int queryInviteSum(String id);
	
	public boolean updateRegister(Customer customer);

	public List<TeamShareCustomer> queryOneTeamShare(String id);
	
	public int queryOneTeamShareCount(String id);
	
	public List<TeamShareCustomer> queryTwoTeamShare(String id);
	
	public int queryTwoTeamShareCount(String id);
	
	public List<Customer> queryCurrentChildCustomer(String id);
	
	public Customer queryModelByPhone(String phone);
	
	public List<TeamShareCustomer>queryWechatSearch(String searchContent,String id);

	//用于后台的查询方法
    public List<Customer> queryListMP(CustomerSearch customerSearch,PagerModel pagerModel);
	
	public List<Customer> queryListMP(CustomerSearch customerSearch);
	
	public int queryCountMP(CustomerSearch customerSearch);
	
	public Customer queryModelMP(String key);
	
	public List<Customer> queryListById(CustomerSearch customerSearch,PagerModel pagerModel,String key);
    
	public int queryCountById(CustomerSearch customerSearch,String key);
	
	public boolean updateMaker(String openId);
	
	public boolean updateHighMaker(String openId);
	
	//public boolean updateLevelDetailed(String id,String level,String phone,String username,String region);
	
	public Customer queryRefereeModelByOpenId(String openId);

	public boolean queryPhoneExisted(String phoneNum);
	
	public boolean updateCustomerByJoinMaker(Customer customer);
	
	public boolean updateCustDetail(Customer customer);

	public List<Customer> queryListByBuyer(String loginId);
	
	public boolean updateCustomerState(String loginId,String autonym,String username,String idType,String idCode);

	//改变实名认证的状态
	public Boolean updateCustomerStateById(String id, String state);

	public List<Customer> queryListForAward(Date startDate,Date endDate);
	
	//查询城市下的每一天的关注数增加情况
    public HashMap<String,String> queryCustCount(String state,CustomerSearch search);
    
    //查询城市下从开始到这一天的关注总数
    public HashMap<String,String> queryAllCustCount(String state,CustomerSearch search);
    
    //更改密码
    
    public Boolean updatePassword(String newPassword, String customerId,String unionMark);
    
    //用于展示树形结构的方法
    public List<CustomerTree> queryCustomerTreeList(CustomerSearch search);
    
    //查找某一个人的所有消费情况
    public CustomerTree queryModelForConsumption(CustomerSearch search);
    
    //查找某一个人下级的的所有消费情况
    public List<CustomerTree> queryListForConsumption(CustomerSearch search);
    
    public CustomerStatistic queryModel(CustomerSearch search);
    
    /*<----------------------------API------------------------->*/
    public Customer login(String userId,String password);
    
    public Boolean queryUnionId(String unionId);

    public Customer queryModelByUnionId(String unionId);
    

    public Customer queryModelByUnionIdOrPhone(String unionId,String phone);


    public boolean updateCustomerColumn(List<CustomerColumn> customerColumns);
        
    //查询每日招募创客数
    public int queryCountDayMakers(String refereeId);
    
    //查询每周招募创客数
    public int queryCountWeekMakers(String refereeId);
    
    //查询每月招募创客数
    public int queryCountMonthMakers(String refereeId);
    
    //每日是否招募到1名以上创客
  	public Boolean queryIsCountDayMaker(String refereeId);
  	
  	//每周是否招募到3名以上创客
  	public Boolean queryIsCountWeekMaker(String refereeId);
  	
  	//每日月是否招募到10名以上创客
  	public Boolean queryIsCountMonthMaker(String refereeId);
  	
  	//查询下一级是游客
  	public List<Customer> queryNextVisitors(String refereeId);
}
